package com.hd.appcommon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hd.appcommon.entity.OrgMember;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author memberistrator
 * @since 2020-11-24
 */
@Repository
@Mapper
public interface OrgMemberMapper extends BaseMapper<OrgMember> {

    @Select(" select m.* from org_member m " +
            " inner join org_member_role mr " +
            " on m.org_member_id = mr.org_member_id " +
            " where mr.role_id = #{roleId} " +
            " and m.org_member_delete_state =  #{orgMemberDeleteState} ")
    List<OrgMember> listByRoleId(@Param("roleId") String roleId, @Param("orgMemberDeleteState") int orgMemberDeleteState);
}
